package pojo;

import Mysqlcon.Conn;

import java.sql.ResultSet;

public class Sqlentity extends Conn {
	public Sqlentity() {
		Conn con = new Conn();
	}

	public static ResultSet select(String sql) throws Exception {
//封装了sql查询功能
		sta = connection.createStatement();
		res = sta.executeQuery(sql);

		return res;

	}

	public void execute(String sql) throws Exception {
		sta = connection.createStatement();
//封装了sql增删改功能
		int i = sta.executeUpdate(sql);
		if (i!=-1){
			System.out.println("操作成功");
		}else{
			System.out.println("操作失败");
		}

	}
}
